﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NZBMatrixAdvancedFeedReader.Classes
{
    public class SearchTemplate
    {

        #region Constructor

        static SearchTemplate()
        {
            //  Intialize the File Category List.
            //  You can enabled the others and extend the features to other files informations.
            _CategoriesLookup = new Dictionary<string, string>();
            //_CategoriesLookup.Add("28", "Anime: All");
            //_CategoriesLookup.Add("20", "Apps: Linux");
            //_CategoriesLookup.Add("19", "Apps: Mac");
            //_CategoriesLookup.Add("21", "Apps: Other");
            //_CategoriesLookup.Add("18", "Apps: PC");
            //_CategoriesLookup.Add("52", "Apps: Portable");
            //_CategoriesLookup.Add("53", "Documentaries: HD");
            //_CategoriesLookup.Add("9", "Documentaries: SD");
            //_CategoriesLookup.Add("45", "Games: DS");
            //_CategoriesLookup.Add("17", "Games: Other");
            //_CategoriesLookup.Add("10", "Games: PC");
            //_CategoriesLookup.Add("11", "Games: PS2");
            //_CategoriesLookup.Add("43", "Games: PS3");
            //_CategoriesLookup.Add("12", "Games: PSP");
            //_CategoriesLookup.Add("44", "Games: Wii");
            //_CategoriesLookup.Add("51", "Games: Wii VC");
            //_CategoriesLookup.Add("13", "Games: Xbox");
            //_CategoriesLookup.Add("14", "Games: Xbox360");
            //_CategoriesLookup.Add("56", "Games: Xbox360 (Other)");
            _CategoriesLookup.Add("50", "Movies: HD (Image)");
            _CategoriesLookup.Add("54", "Movies: HD (Remux)");
            _CategoriesLookup.Add("42", "Movies: HD (x264)");
            _CategoriesLookup.Add("4", "Movies: Other");
            _CategoriesLookup.Add("2", "Movies: SD");
            _CategoriesLookup.Add("1", "Movies: SD (Image)");
            //_CategoriesLookup.Add("24", "Music: DVD");
            //_CategoriesLookup.Add("23", "Music: Lossless");
            //_CategoriesLookup.Add("22", "Music: MP3 Albums");
            //_CategoriesLookup.Add("47", "Music: MP3 Singles");
            //_CategoriesLookup.Add("27", "Music: Other");
            //_CategoriesLookup.Add("25", "Music: Video");
            //_CategoriesLookup.Add("55", "Other: Android");
            //_CategoriesLookup.Add("49", "Other: Audio Books");
            //_CategoriesLookup.Add("36", "Other: E-Books");
            //_CategoriesLookup.Add("39", "Other: Extra Pars/Fills");
            //_CategoriesLookup.Add("37", "Other: Images");
            //_CategoriesLookup.Add("38", "Other: iOS/iPhone");
            //_CategoriesLookup.Add("40", "Other: Other");
            //_CategoriesLookup.Add("26", "Other: Radio");
            //_CategoriesLookup.Add("57", "TV: HD (Image)");
            //_CategoriesLookup.Add("41", "TV: HD (x264)");
            //_CategoriesLookup.Add("8", "TV: Other");
            //_CategoriesLookup.Add("6", "TV: SD");
            //_CategoriesLookup.Add("5", "TV: SD (Image)");
            //_CategoriesLookup.Add("7", "TV: Sport/Ent");
        }

        #endregion
        
        #region Enums

        public enum LinkTypes
        {
            NZBLinkDetailsLink,
            NZBDownloadLink
        }

        public enum SearchMethods
        {
            NZBName,
            UsenetPostSubject,
            Weblink
        }

        #endregion
        
        #region Properties

        public static Dictionary<string, string> CategoriesLookup
        {
            get
            {
                return _CategoriesLookup;
            }
        }

        public string Name { get; set; }
        public string Categories
        {
            get
            {
                return _Categories;
            }
            set
            {
                _Categories = value;
            }
        }
        public LinkTypes LinkType { get; set; }
        public bool EnglishOnly { get; set; }
        public bool UseSSL { get; set; }
        public bool PreserveFileName { get; set; }
        public int MaxPostAge { get; set; }
        public string SearchTerm { get; set; }
        public SearchMethods SearchMethod { get; set; }
        public bool HasMovieYearLimit { get; set; }
        public string MovieYearFrom { get; set; }
        public string MovieYearTo { get; set; }
        public bool HasMovieRateLimit { get; set; }
        public string MovieRateFrom { get; set; }
        public string MovieRateTo { get; set; }

        #endregion
        
        #region local variables

        private static Dictionary<string, string> _CategoriesLookup;
        private string _Categories;

        #endregion

    }
}
